import React,{Component} from 'react';
import {inject,observer} from 'mobx-react';

@inject('Car')
@observer
class Count extends Component{
    change = (flag) => {
        console.log(this.props.id)
        this.props.Car.changeShopCar(flag,this.props.id)
    }
    render(){
        return <div>
            <button onClick={this.change.bind(this,true)}>+</button>
            <span>{this.props.count}</span>
            <button onClick={this.change.bind(this,false)}>-</button>
        </div>
    }
}

export default Count